import 'package:json_annotation/json_annotation.dart';
import 'package:stock_check/common/model/taskItemDetail.dart';

@JsonSerializable()
class UploadTaskBean{
  int taskId;
  String eqptNo; //资产编号
  String position; //位置
  int assetId; //资产id

  UploadTaskBean({this.taskId, this.eqptNo, this.position, this.assetId});

  UploadTaskBean.empty();

  factory UploadTaskBean.fromJson(Map<String,dynamic> json){
    return UploadTaskBean(taskId:json['taskId'] as int, eqptNo:json['eqptNo'] as String,
        position:json['position'] as String, assetId:json['assetId'] as int);
  }

  Map<String, dynamic> toJson() => _toJson(this);


  static UploadTaskBean copy(TaskDetailItem instance) {
    return UploadTaskBean(
        taskId: instance.taskId,
        eqptNo: instance.eqptNo,
        position: instance.position,
        assetId: instance.assetId
    );
  }

  _toJson(UploadTaskBean instance) {
      return<String, dynamic>{
        'taskId': instance.taskId,
        'eqptNo': instance.eqptNo,
        'position': instance.position,
        'assetId': instance.assetId
      };
  }
}